package com.xms.security.data;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xms.security.entity.Privilege;
import com.xms.security.entity.UserPrivilege;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.UUID;

/**
 * <p>
 * SystemUserPermissionService
 * </p>
 *
 * @author migo
 * @since 2021/9/11
 */
public interface SystemUserPermissionMapper extends BaseMapper<UserPrivilege> {
    Privilege getAuthPrivilege(@Param("systemuserid") UUID systemUserId, @Param("areaname") String areaName, @Param("classname") String className, @Param("methodname") String methodName, @Param("objecttypecode") int objectTypeCode);

    Privilege getAuthPrivilegeByUrl(@Param("systemuserid") UUID systemUserId, @Param("url") String url, @Param("objecttypecode") int objectTypeCode);

    List<UUID> getNoneReadFields(@Param("systemuserid") UUID systemUserId, @Param("securityfields") List<UUID> securityfields, @Param("objecttypecode") int objectTypeCode);

    List<UUID> getNoneEditFields(@Param("systemuserid") UUID systemUserId, @Param("securityfields") List<UUID> securityFields, @Param("objecttypecode") int objectTypeCode);

    List<Privilege> getPrivileges(@Param("systemuserid") UUID systemUserId, @Param("objecttypecode") int objectTypeCode);
}
